define("mobile", [], (require, exports, module) => {
	exports.done = (store, progress) => {
		$.use("header main footer list gotop".split(' '), () => {
			var bool = true,
				header = require("header").done(bool),
				main = require("main").done(bool),
				footer = require("footer").done(bool),
				gotop = require("gotop").done();

			$.extend($.__mod__.tmplThesaurus, {
				replaceHttp: function(val, filterCondition){
					return val.replace(/http[s]*\:\/\//gim, filterCondition)
				}
			});

			var pageHTML = (<div></div>)._append([header.html, header.css, main.html, main.css, footer.html, footer.css, gotop.css]);
			gotop.js.render(gotop.html);
			var list = require("list").done(bool);

			function loadData(callback){
				progress.end();
				progress.start(() => {
					//$.router("/dplus?handle=页面浏览&"+store.get("state").dplus["indexPageView"]);
				}, (end) => {
					store.get("handle").getListData({
						id:"195509106"
					}, (res, all) => {
						$.extend(store.get("props"), {
							listData: $.extend(store.get("props").listData || [], res)
						});
						end();
					}, (err) => {
						console.log(err);
						end();
					});
				}, () => {
					callback && callback();
				});
			}
			var pageNumber = 0;
			$.render(pageHTML, $.extend(store.get("props"), {
				type: "normalList"
			}), $.query("#app"), () => {
				$.query("head")[0]._append(list.css);
				loadData(() => {
					console.log("end!");
					$.render((<div></div>)._append(list.html), store.get("props"), $.query(".main_content"), () => {
						$.Page(null, {
							delay: 500
						}).scrollLoadMore(() => {
							if (pageNumber<2){
								loadData(() => {
									$.query(".main_content")[0]._append((<div class="more"></div>)._addClass("page_"+pageNumber));
									$.render((<div></div>)._append(list.html), store.get("props"), $.query(".page_"+pageNumber));
									pageNumber+=1;
									if (pageNumber >=2){
										!$.query(".page_end")[0] && $.query(".main_content")[0]._append([@lessParse(<style>
											@base: 23.44/1rem;
											.page_end{
												padding:5/@base 0;
												font-size:12/@base;
												color:#ccc;
												text-align:center;
												display:block;
											}
										</style>),(<div class="page_end">已经到底了.</div>)]);
									}
								});
							}
						});
					});
				});
			});
		});
	};
});